package com.service.lx;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.dao.lx.SystemlogDAO;
import com.entity.Systemlog;
import com.service.ServiceException;


@Service
@Transactional(rollbackFor = Exception.class)
public class SystemlogService {
	@Autowired
	private SystemlogDAO systemlogDAO;
	/**
	 * 添加/修改/逻辑删除
	 * @param user
	 * @throws ServiceException
	 */
	public void addAndUpdateSystemlog(Systemlog systemlog) throws ServiceException{
		try {
			systemlog.setSystemlogIntodate(new Date());
			systemlogDAO.save(systemlog);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e);
		}
	}
	
	/**
	 * 删除
	 * @param systemlogid
	 * @throws ServiceException
	 */
	public void deleteSystemlog(Long systemlogid) throws ServiceException{
		try {
			systemlogDAO.delete(systemlogid);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e);
		}
	}
	/**
	 * 单条查询
	 * @param systemlogid
	 * @return
	 */
	public Systemlog findOne(Long systemlogid) {
		return systemlogDAO.findOne(systemlogid);
	}

}
